package com.itheima.project.feign;

import com.itheima.project.basic.ResponseWrap;
import com.itheima.project.hystrix.NativePayHystrix;
import com.itheima.project.vo.trade.RefundRecordVo;
import com.itheima.project.vo.trade.TradingVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * @ClassName NativePayFace.java
 * @Description Native支付方式Face接口：商户生成二维码，用户扫描支付
 */
@FeignClient(value = "module-trade-web",fallback = NativePayHystrix.class )
public interface NativePayFeign {

    /***
     * @description 统一收单线下交易预创建
     * 收银员通过收银台或商户后台调用此接口，生成二维码后，展示给用户，由用户扫描二维码完成订单支付。
     * @param tradingVo 订单单
     * @return  二维码路径
     */
    @PostMapping("trade-native/create-down-line-trading")
    ResponseWrap<TradingVo> createDownLineTrading(@RequestBody TradingVo tradingVo);

    /**
     * 查看二维码
     * @param orderNo
     * @return
     */
    @GetMapping("trade-native/queryQrCode/{orderNo}")
    public ResponseWrap<String> queryQrCode(@PathVariable("orderNo") Long orderNo);
}
